package com.aohe.youzi.fragment.home;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.viewbinding.ViewBinding;

import com.aohe.youzi.R;
import com.aohe.youzi.databinding.FragmentHomeBinding;
import com.aohe.youzi.mvp.MvpFragment;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class HomeFragment extends MvpFragment<HomePresenter> implements IHomeView {

    private FragmentHomeBinding binding;

    @Override
    protected void initView(Bundle savedInstanceState) {
        binding.tvSearch.setOnClickListener(this::onViewClicked);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected ViewBinding getViewBinding() {
        binding = FragmentHomeBinding.inflate(getLayoutInflater());
        return binding;
    }

    @NonNull
    @Override
    public HomePresenter createPresenter() {
        return new HomePresenter();
    }

    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_search://查询
//                AppRouter.showFragmentActivity(mContext, SearchActivity.class);
                break;
        }
    }
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMainThread(Object object) {
    }
}
